<?xml version="1.0" encoding="UTF-8"?>
<schema
	xmlns:gml="http://www.opengis.net/gml/3.2"
	xmlns:gmd="http://www.isotc211.org/2005/gmd"
	xmlns="http://www.w3.org/2001/XMLSchema"
	xmlns:om="http://www.opengis.net/om/2.0"
	targetNamespace="http://www.opengis.net/om/2.0"
	elementFormDefault="qualified"
	attributeFormDefault="unqualified"
	version="2.0.0">
	<annotation>
		<documentation> observation.xsd 
			
			Observations and Measurements - XML Implementation is an OGC Standard.
			
			Copyright (c) [2010] Open Geospatial Consortium, Inc. All Rights Reserved.
			To obtain additional rights of use, visit http://www.opengeospatial.org/legal/.
		</documentation>
	</annotation>
	<!-- ====================================================================== -->
	<!-- bring in other schemas -->
	<import
		namespace="http://www.opengis.net/gml/3.2"
		schemaLocation="../../gml/3.2.1/gml.xsd"/>
	<import
		namespace="http://www.isotc211.org/2005/gmd"
		schemaLocation="../../iso/19139/20070417/gmd/gmd.xsd"/>
	<!-- ====================================================================== -->
	<!-- ====================================================================== -->
	<!-- ===== Common properties of observations ====== -->
	<!-- ====================================================================== -->
	<group
		name="OM_CommonProperties">
		<annotation>
			<documentation>Base type for Observations. Observation is an act ("event"), whose result
				is an estimate of the value of a property of the feature of interest. The observed
				property may be any property associated with the type of the feature of interest.
				Concrete observation types must add a *result* property of a suitable type.
			</documentation>
		</annotation>
		<sequence>
			<element
				name="type"
				type="gml:ReferenceType"
				minOccurs="0">
				<annotation>
					<documentation>If present, the sub-element 'type' shall indicate the class of
						observation. A register of type identifiers corresponding with the
						observation types in ISO 19156, which distinguishes types on the basis of
						the type of the result, is provided by OGC at
						http://www.opengis.net/def/observationType/OGC-OM/2.0/ </documentation>
				</annotation>
			</element>
			<element
				name="metadata"
				type="gmd:MD_Metadata_PropertyType"
				minOccurs="0">
				<annotation>
					<documentation> If present, the association Metadata shall link the
						OM_Observation to descriptive metadata. </documentation>
				</annotation>
			</element>
			<element
				name="relatedObservation"
				type="om:ObservationContextPropertyType"
				minOccurs="0"
				maxOccurs="unbounded">
				<annotation>
					<documentation> Some observations depend on other observations to provide
						context which is important, sometimes essential, in understanding the
						result. These dependencies are stronger than mere spatiotemporal
						coincidences, requiring explicit representation. If present, the association
						class ObservationContext (Figure 2) shall link a OM_Observation to another
						OM_Observation, with the role name relatedObservation for the target.
					</documentation>
				</annotation>
			</element>
			<element
				name="phenomenonTime"
				type="om:TimeObjectPropertyType">
				<annotation>
					<documentation> The attribute phenomenonTime:TM_Object shall describe the time
						that the result (6.2.2.9) applies to the property of the feature-of-interest
						(6.2.2.7). This is often the time of interaction by a sampling procedure
						(8.1.3) or observation procedure (6.2.2.10) with a real-world feature.
					</documentation>
				</annotation>
			</element>
			<element
				name="resultTime"
				type="gml:TimeInstantPropertyType"
				block="#all">
				<!-- om:resultTime is used in schematron-based validaty tests, so must not be changed -->
				<annotation>
					<documentation> The attribute resultTime:TM_Instant shall describe the time when
						the result became available, typically when the procedure (6.2.2.10)
						associated with the observation was completed For some observations this is
						identical to the samplingTime. However, there are important cases where they
						differ. </documentation>
				</annotation>
			</element>
			<element
				name="validTime"
				type="gml:TimePeriodPropertyType"
				minOccurs="0">
				<annotation>
					<documentation> If present, the attribute validTime:TM_Period shall describe the
						time period during which the result is intended to be used. </documentation>
				</annotation>
			</element>
			<element
				name="procedure"
				type="om:OM_ProcessPropertyType"
				nillable="true">
				<annotation>
					<documentation> The association ProcessUsed shall link the OM_Observation to the
						OM_Process (6.2.3) used to generate the result. The process has the role
						procedure with respect to the observation. A process might be responsible
						for more than one generatedObservation. </documentation>
				</annotation>
			</element>
			<element
				name="parameter"
				type="om:NamedValuePropertyType"
				minOccurs="0"
				maxOccurs="unbounded">
				<annotation>
					<documentation> If present, the attributes parameter:NamedValue shall describe
						an arbitrary event-specific parameter. This might be an environmental
						parameter, an instrument setting or input, or an event-specific sampling
						parameter that is not tightly bound to either the feature-of-interest
						(6.2.2.7) or to the observation procedure (6.2.2.10). To avoid ambiguity,
						there shall be no more than one parameter with the same name. NOTE
						Parameters that are tightly bound to the procedure may be recorded as part
						of the procedure description. In some contexts the Observation::procedure
						(6.2.2.10) is a generic or standard procedure, rather than an event-specific
						process. In this context, parameters bound to the observation act, such as
						instrument settings, calibrations or inputs, local position, detection
						limits, asset identifier, operator, may augment the description of a
						standard procedure. </documentation>
				</annotation>
			</element>
			<element
				name="observedProperty"
				type="gml:ReferenceType"
				nillable="true">
				<annotation>
					<appinfo>
						<gml:targetElement>xs:anyType</gml:targetElement>
					</appinfo>
					<documentation> The association Phenomenon shall link the OM_Observation to the
						GFI_PropertyType (C.2.2) for which the OM_Observation:result (6.2.2.9)
						provides an estimate of its value. The property type has the role
						observedProperty with respect to the observation. The observed property
						shall be a phenomenon associated with the type of the featureOfInterest.
						NOTE An observed property may, but need not be modelled as a property (in
						the sense of the General Feature Model) in a formal application schema that
						defines the type of the feature of interest The observed property supports
						semantic or thematic classification of observations, which is useful for
						discovery and data fusion. </documentation>
				</annotation>
			</element>
			<element
				name="featureOfInterest"
				type="gml:FeaturePropertyType"
				nillable="true">
				<annotation>
					<documentation> The association Domain shall link the OM_Observation to the
						GFI_Feature (C.2.1) that is the subject of the observation and carries the
						observed property. This feature has the role featureOfInterest with respect
						to the observation. This feature is the real-world object whose properties
						are under observation, or is a feature intended to sample the real-world
						object, as described in Clause 8 of this International Standard. An
						observation instance serves as a propertyValueProvider for its feature of
						interest. </documentation>
				</annotation>
			</element>
			<element
				name="resultQuality"
				type="gmd:DQ_Element_PropertyType"
				minOccurs="0"
				maxOccurs="unbounded">
				<annotation>
					<documentation> If present, the attributes resultQuality:DQ_Element shall
						describe the quality of the result (6.2.2.9). This instance-specific
						description complements the description of the observation procedure
						(6.2.2.10), which provides information concerning the quality of all
						observations using this procedure. Quality of a result may be assessed
						following the procedures in ISO 19114:2003. Multiple measures may be
						provided (ISO/TS 19138:2006). </documentation>
				</annotation>
			</element>
		</sequence>
	</group>
	<!-- ====================================================================== -->
	<!-- ===== Generic Observation result ======= -->
	<!-- ===== global element in order to support restriction across namespace boundaries ======= -->
	<!-- ====================================================================== -->
	<element
		name="result">
		<annotation>
			<documentation> The association Range shall link the OM_Observation to the value
				generated by the procedure. The value has the role result with respect to the
				observation. The type of the result is shown as Any, since it may represent the
				value of any feature property. NOTE 1 OGC SWE Common provides a model suitable for
				describing many kinds of observation results. The type of the observation result
				shall be consistent with the observed property, and the scale or scope for the value
				shall be consistent with the quantity or category type. If the observed property
				(6.2.2.8) is a spatial operation or function, the type of the result may be a
				coverage, NOTE 2 In some contexts, particularly in earth and environmental sciences,
				the term “observation” is used to refer to the result itself. </documentation>
		</annotation>
	</element>
	<!-- ====================================================================== -->
	<!-- ===== Generic Observation ======= -->
	<!-- ====================================================================== -->
	<complexType
		name="OM_ObservationType">
		<annotation>
			<documentation> Generic observation, whose result is anyType The following properties
				are inherited from AbstractFeatureType: <!--	from AbstractGMLType
					<element ref="gml:metaDataProperty" minOccurs="0" maxOccurs="unbounded"/>
					<element ref="gml:description" minOccurs="0"/>
					<element ref="gml:name" minOccurs="0" maxOccurs="unbounded"/> -->
				<!--    from AbstractFeatureType
				<element ref="gml:boundedBy" minOccurs="0"/> -->
			</documentation>
		</annotation>
		<complexContent>
			<extension
				base="gml:AbstractFeatureType">
				<sequence>
					<group
						ref="om:OM_CommonProperties"/>
					<element
						ref="om:result"/>
				</sequence>
			</extension>
		</complexContent>
	</complexType>
	<!-- ......................... -->
	<element
		name="OM_Observation"
		type="om:OM_ObservationType"
		substitutionGroup="gml:AbstractFeature">
		<annotation>
			<documentation>Observation is an act ("event"), whose result is an estimate of the value
				of a property of the feature of interest. The observed property may be any property
				associated with the type of the feature of interest.</documentation>
		</annotation>
	</element>
	<!-- ...................... -->
	<complexType
		name="OM_ObservationPropertyType">
		<sequence
			minOccurs="0">
			<element
				ref="om:OM_Observation"/>
		</sequence>
		<attributeGroup
			ref="gml:AssociationAttributeGroup"/>
	</complexType>
	<!-- ====================================================================== -->
	<!-- ===== Observation Context  ======= -->
	<!-- ====================================================================== -->
	<complexType
		name="ObservationContextType">
		<annotation>
			<documentation> Some observations depend on other observations to provide context which
				is important, sometimes essential, in understanding the result. These dependencies
				are stronger than mere spatiotemporal coincidences, requiring explicit
				representation. If present, the association class ObservationContext (Figure 2)
				shall link a OM_Observation to another OM_Observation, with the role name
				relatedObservation for the target. </documentation>
		</annotation>
		<sequence>
			<element
				name="role"
				type="gml:ReferenceType">
				<annotation>
					<documentation>The attribute 'role' shall describe the relationship of the
						target OM_Observation to the source OM_Observation. </documentation>
				</annotation>
			</element>
			<element
				name="relatedObservation"
				type="gml:ReferenceType">
				<annotation>
					<appinfo>
						<gml:targetElement>om:OM_Observation</gml:targetElement>
					</appinfo>
					<documentation> Some observations depend on other observations to provide
						context which is important, sometimes essential, in understanding the
						result. These dependencies are stronger than mere spatiotemporal
						coincidences, requiring explicit representation. If present, the association
						class ObservationContext (Figure 2) shall link a OM_Observation to another
						OM_Observation, with the role name relatedObservation for the target.
					</documentation>
				</annotation>
			</element>
		</sequence>
	</complexType>
	<!-- ......................... -->
	<element
		name="ObservationContext"
		type="om:ObservationContextType">
		<annotation>
			<documentation> Some observations depend on other observations to provide context which
				is important, sometimes essential, in understanding the result. These dependencies
				are stronger than mere spatiotemporal coincidences, requiring explicit
				representation. If present, the association class ObservationContext (Figure 2)
				shall link a OM_Observation to another OM_Observation, with the role name
				relatedObservation for the target. </documentation>
		</annotation>
	</element>
	<!-- ...................... -->
	<complexType
		name="ObservationContextPropertyType">
		<annotation>
			<documentation>ObservationContext is a dataType, without identity, so may only be used
				inline</documentation>
		</annotation>
		<sequence>
			<element
				ref="om:ObservationContext"/>
		</sequence>
	</complexType>
	<!-- ====================================================================== -->
	<!-- ===== Observation process  ======= -->
	<!-- ====================================================================== -->
	<complexType
		name="OM_ProcessPropertyType">
		<annotation>
			<documentation> The purpose of an observation process is to generate an observation
				result. An instance is often an instrument or sensor, but may be a human observer, a
				simulator, or a process or algorithm applied to more primitive results used as
				inputs. The model for OM_Process is abstract, and has no attributes, operations, or
				associations. NOTE ISO 19115-2:2008 provides MI_Instrument, LE_Processing and
				LE_Algorithm, which could all be modelled as specializations of OM_Process. Any
				suitable XML may be used to describe the observation process in line, provided that
				it is contained in a single XML element. If reference to a schema is provided it
				must also be valid. OGC SensorML provides a model which is suitable for many
				observation procedures. </documentation>
		</annotation>
		<sequence
			minOccurs="0">
			<any
				namespace="##any"
				processContents="lax">
				<annotation>
					<documentation> Any suitable XML may be used to describe the observation process
						in line, provided that it is contained in a single XML element. If refernece
						to a schema is provided it must also be valid. </documentation>
				</annotation>
			</any>
		</sequence>
		<attributeGroup
			ref="gml:AssociationAttributeGroup"/>
	</complexType>
	<!-- ====================================================================== -->
	<!-- ===== Named Value  ======= -->
	<!-- ====================================================================== -->
	<complexType
		name="NamedValueType">
		<annotation>
			<documentation> The class 'NamedValue' provides for a generic soft-typed parameter
				value. NamedValue shall support two attributes. </documentation>
		</annotation>
		<sequence>
			<element
				name="name"
				type="gml:ReferenceType">
				<annotation>
					<documentation> The attribute 'name' shall indicate the meaning of the named
						value. Its value should be taken from a well-governed source if possible.
					</documentation>
				</annotation>
			</element>
			<element
				name="value">
				<annotation>
					<documentation> The attribute 'value' shall provide the value. The type Any
						should be substituted by a suitable concrete type, such as
						CI_ResponsibleParty or Measure. </documentation>
				</annotation>
			</element>
		</sequence>
	</complexType>
	<!-- ......................... -->
	<element
		name="NamedValue"
		type="om:NamedValueType">
		<annotation>
			<documentation> The class 'NamedValue' provides for a generic soft-typed parameter
				value. NamedValue shall support two attributes. </documentation>
		</annotation>
	</element>
	<!-- ...................... -->
	<complexType
		name="NamedValuePropertyType">
		<annotation>
			<documentation> The class 'NamedValue' provides for a generic soft-typed parameter
				value. NamedValue shall support two attributes. </documentation>
		</annotation>
		<sequence
			minOccurs="0">
			<element
				ref="om:NamedValue"/>
		</sequence>
		<attributeGroup
			ref="gml:AssociationAttributeGroup"/>
	</complexType>
	<!-- ====================================================================== -->
	<!-- ===== TimeObjectProperty  ======= -->
	<!-- ====================================================================== -->
	<complexType
		name="TimeObjectPropertyType">
		<annotation>
			<documentation>This property type is not provided directly by GML</documentation>
		</annotation>
		<sequence
			minOccurs="0">
			<element
				ref="gml:AbstractTimeObject"/>
		</sequence>
		<attributeGroup
			ref="gml:AssociationAttributeGroup"/>
	</complexType>
	<!-- ====================================================================== -->
	<!-- ====================================================================== -->
	<!-- ====================================================================== -->
</schema>
